﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="ListClasses.aspx.cs" Inherits="cs499.Classes.ListClasses" %>
<%@ MasterType VirtualPath="~/Site.Master" %>


<asp:Content runat="server" ID="navbar" ContentPlaceHolderID="NavOptions">
    <ul>
        <li><asp:LinkButton ID="addclassbutton" runat="server" PostBackUrl="~/Classes/AddClass.aspx">Add Class</asp:LinkButton></li>
        <li><asp:LinkButton ID="deleteclassbutton" runat="server" PostBackUrl="~/Classes/DeleteClass.aspx">Delete Class(es)</asp:LinkButton></li>
        <li><asp:LinkButton ID="importclassbutton" runat="server" PostBackUrl="~/Classes/ImportClass.aspx">Import Class(es)</asp:LinkButton></li>
        <li><asp:LinkButton ID="exportclassbutton" runat="server" OnClick="exportclassbutton_Click">Export Class(es)</asp:LinkButton></li>
    </ul>
</asp:Content>
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <h3><asp:Label ID="ListActionMessage" runat="server" Text="" />  List of Classes For <asp:Label ID="DepartmentLabel" runat="server" Text="" /></h3>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="EntityDataSource1">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/Classes/EditClass.aspx?ID={0}" Text="Edit" HeaderText="" />
            <asp:BoundField DataField="Number" HeaderText="Number" SortExpression="Number" />
            <asp:BoundField DataField="CourseTitle" HeaderText="Course Title" SortExpression="CourseTitle" />
            <asp:BoundField DataField="NumberOfSections" HeaderText="Number Of Sections" SortExpression="NumberOfSections" />
            <asp:BoundField DataField="MaximumEnrollment" HeaderText="Maximum Enrollment" SortExpression="MaximumEnrollment" />
            <asp:BoundField DataField="PlaceRequirementsstring" HeaderText="Location Requirements" SortExpression="PlaceRequirementsstring" />
        </Columns>
    </asp:GridView>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Model1Container" DefaultContainerName="Model1Container" EntitySetName="Courses" EntityTypeFilter="Course" Where="it.DepartmentId=@newparameter" Include="">
    <WhereParameters>
        <asp:SessionParameter DbType="Int32" DefaultValue="-1" Name="newparameter" SessionField="CurrentDepartmentId" />
    </WhereParameters>
</asp:EntityDataSource>
     
</asp:Content>